const APPINFO = {
  appKey: 'ffdc428f8692f0a8387929fd5527e227',
  mapId: 'GDID'
}

var createScript = ({appKey, mapId} = {}) => {
  var url = `https://webapi.amap.com/maps?v=1.4.8&key=${appKey}&callback=mapCreate`
  var jsapi = document.createElement('script')
  jsapi.charset = 'utf-8'
  jsapi.src = url
  document.head.appendChild(jsapi)
}

createScript(APPINFO)

// 地图api接口回调
window.mapCreate = () => {
  var map = new AMap.Map(APPINFO.mapId, {
    zoom: 13
  })
}